package com.hrt.manage.order.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.hrt.base.BaseDaoImpl;
import com.hrt.bean.HRTMember;
import com.hrt.bean.OrderInfor;
import com.hrt.manage.order.dao.OrderInforDao;
@Repository
public class OrderInforDaoImpl extends BaseDaoImpl<OrderInfor> implements OrderInforDao{
	/**
	 * 根据时间查询订单
	 */
	@SuppressWarnings("unchecked")
	@Override
	public List<OrderInfor> getOrderByTime(java.sql.Date startTime, java.sql.Date endTime) {
		String sql = "select orderInfor from OrderInfor orderInfor where OrderInfor.createTime between '"+startTime+"' and '"+endTime+"'";
		return this.getHibernateTemplate().find(sql);
	}
	
	@Override
	public HRTMember queryByName(String name) {
		HRTMember member = null;
		String sql = "from HRTMember a where a.mbrName = '"+name+"'";
		List list = getHibernateTemplate().find(sql);
		if(list!=null&&list.size()>0){
			member = (HRTMember) list.get(0);
		}
		return member;
	}

}
